﻿
Partial Class Shop_Manager
    Inherits System.Web.UI.Page
    Dim CArray(40, 10)
    Public Shared Function MD5(ByVal strSource As String, ByVal Code As Int16) As String
        '这里用的是ascii编码密码原文，如果要用汉字做密码，可以用UnicodeEncoding，但会与ASP中的MD5函数不兼容 
        Dim dataToHash As Byte() = (New System.Text.ASCIIEncoding).GetBytes(strSource)
        Dim hashvalue As Byte() = CType(System.Security.Cryptography.CryptoConfig.CreateFromName("MD5"), System.Security.Cryptography.HashAlgorithm).ComputeHash(dataToHash)
        Dim i As Integer
        Select Case Code
            Case 16 '´选择16位字符的加密结果 
                For i = 4 To 11
                    MD5 += Hex(hashvalue(i)).ToLower
                Next
            Case 32 ' ´选择32位字符的加密结果 
                For i = 0 To 15
                    MD5 += Hex(hashvalue(i)).ToLower
                Next
            Case Else ' ´Code错误时，返回全部字符串，即32位字符 
                For i = 0 To hashvalue.Length - 1
                    MD5 += Hex(hashvalue(i)).ToLower
                Next
        End Select
    End Function
    Function EncodeBase64(ByVal StrA)
        Dim BufferA As Byte()
        BufferA = System.Text.Encoding.Default.GetBytes(StrA)
        Dim StrB As String
        StrB = Convert.ToBase64String(BufferA)
        EncodeBase64 = StrB
    End Function
    Function DecodeBase64(ByVal StrA)
        DecodeBase64 = Encoding.GetEncoding("gb2312").GetString(Convert.FromBase64String(StrA))
    End Function
    Function getstr(ByVal iRemote)
        On Error Resume Next
        Dim xPost, sGet
        xPost = Server.CreateObject("msxml2.serverxmlhttp") 'msxml2.serverxmlhttp
        xPost.Open("GET", iRemote, False)
        xPost.Send()
        sGet = CreateObject("ADODB.Stream")
        sGet.Mode = 3
        sGet.Type = 1
        sGet.Open()
        sGet.Write(xPost.responseBody)
        sGet.Position = 0
        sGet.Type = 2
        sGet.Charset = "gb2312" ' "gb2312"
        getstr = sGet.ReadText
    End Function


    Function LoadFile(ByVal File)
        Dim objStream
        On Error Resume Next
        objStream = Server.CreateObject("ADODB.Stream")
        If Err.Number = -2147221005 Then
            Response.Write(DecodeBase64("PGRpdiBhbGlnbj0nY2VudGVyJz63x7Oj0sW6tizE+rXE1ve7+rK71qez1kFET0RCLlN0cmVhbdfpvP4szt63qNX9s6O9+NDQyM/WpLrNssm8ryE8L2Rpdj48YSBocmVmPWh0dHA6Ly96aHVqaS50YW9kZC5vcmcgdGFyZ2V0PV9ibGFuaz7M1LartqvW97v6LM3qw8DWp7PWzNS2q7arMi4wPC9hPg=="))
            Err.Clear()
            Response.End()
        End If
        With objStream
            .Type = 2
            .Mode = 3
            .Open()
            .LoadFromFile(Server.MapPath(File))
            If Err.Number <> 0 Then
                response.write(DecodeBase64("PHNjcmlwdCB0eXBlPSJ0ZXh0L2phdmFzY3JpcHQiPmFsZXJ0KCe21LK7xvCjrEtFWdLRyqfQp6Osx+vW2NDCyM/WpEtFWSEnKTt0aGlzLmxvY2F0aW9uLmhyZWY9J2h0dHA6Ly93d3cudGFvZGQub3JnJzs8L3NjcmlwdD48YSBocmVmPWh0dHA6Ly93d3cudGFvZGQub3JnPrXj1eLA78/C1NjQwrXEytrIqM7EvP48L2E+"))
                Err.Clear()
                Response.End()
            End If
            .Charset = "GB2312"
            .Position = 2
            LoadFile = .ReadText
            .Close()
        End With
        objStream = Nothing
    End Function


    Public Shared Function MD5x(ByVal strSource As String, ByVal Code As Int16) As String
        '这里用的是ascii编码密码原文，如果要用汉字做密码，可以用UnicodeEncoding，但会与ASP中的MD5函数不兼容 
        Select Case Code
            Case 16 '´选择16位字符的加密结果 
                MD5x = System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(strSource, "MD5").ToLower().Substring(8, 16)
            Case 32 ' ´选择32位字符的加密结果 
                MD5x = System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(strSource, "MD5").ToLower()
        End Select
    End Function
    Function gethtml(ByVal tmp, ByVal s, ByVal e)
        'On Error Resume Next
        Dim String1, String2, arrstr, j
        String1 = s
        String2 = e
        Dim fbegin
        Dim fend
        fbegin = 1
        fend = 1

        Do
            fbegin = InStr(fbegin, tmp, String1)
            If fbegin = 0 Then Exit Function
            fend = InStr(fbegin, tmp, String2)
            arrstr = Mid(tmp, fbegin + Len(String1), fend - (fbegin + Len(String1)))
            gethtml = arrstr

            fbegin = fend + Len(String2)
        Loop While True
    End Function
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        If Request.Cookies("TaoddAdmin") Is Nothing Or Request.Cookies("TaoddPassWord") Is Nothing Then
            Response.Redirect("login.aspx")
        Else
            PassPortCheck()
        End If

        If Request("Action") = "GetSaller" Then
            Dim code, Saller, shopxinyong, shopdengjiB, shopdengjipic
            If Left(LCase(Request("url")), 4) <> "http" Then
                Response.Write("GetSaller|error|请确认您输入的地址是否正确")
                Response.End()
            End If
            code = getstr(Request("url"))

            ' If InStr(code, "掌柜档案") = 0 And InStr(code, "卖家发货的速度") = 0 Then
            If InStr(code, "http://store.taobao.com/tadget/shop_stats.htm") = 0 Then
                Response.Write("GetSaller|error|请确认您输入的链接为一个正常的淘宝店铺或者商品地址！")
                Response.End()
            End If
            'End If
            Dim shopEvaluation
            If InStr(code, "<h3><span>商家信息</span></h3>") Then
                shopxinyong = "-1"
                shopEvaluation = "100"
                Saller = gethtml(code, "|1.htm"">", "</a>")

            Else
                shopxinyong = gethtml(code, "<span>卖家信用：</span>", "/a>", -1) '卖家信用1
                shopxinyong = Replace(shopxinyong, "<span>", "")
                shopxinyong = Replace(shopxinyong, "</span>", "")
                If InStr(shopxinyong, "<span ") Then
                    shopxinyong = Right(shopxinyong, Len(shopxinyong) - InStrRev(shopxinyong, ">"))
                    shopxinyong = Left(shopxinyong, InStr(shopxinyong, "<") - 1)
                Else
                    shopxinyong = gethtml(shopxinyong, """>", "<", -1) '卖家信用2
                End If
            End If
            Dim rateurl, ratecode
            If shopxinyong = "" Then

                rateurl = gethtml(code, "http://rate.taobao.com/user-rate-", ".htm", -1)
                ratecode = getstr("http://rate.taobao.com/user-rate-" & rateurl & ".htm")
                'shopxinyong = gethtml(ratecode, "#RateType"" >" & vbNewLine & Space(1) & Space(1) & Space(1) & Space(1) & Space(1) & Space(1) & Space(1) & Space(1) & Space(1) & Space(1) & Space(1) & Space(1) & vbTab & vbTab & vbTab & vbTab, vbNewLine & Space(1) & Space(1) & Space(1) & Space(1) & Space(1) & Space(1) & Space(1) & Space(1) & Space(1) & Space(1) & Space(1) & Space(1) & vbTab & vbTab & vbTab & "</a>", -1)
                shopEvaluation = gethtml(ratecode, "好评率：<em>", "%</em>", -1)
                shopxinyong = gethtml(ratecode, "<h4 class=""seller"">", "/a>", -1)
                shopxinyong = Replace(shopxinyong, vbTab, "")
                shopxinyong = Replace(shopxinyong, vbNewLine, "")
                shopxinyong = Replace(shopxinyong, " ", "")
                shopxinyong = gethtml(shopxinyong, "RateType"">", "<", -1)
            End If
            If shopxinyong = "" Then
                ' Response.Write("xxxxxxxxxxxx")
                shopxinyong = gethtml(ratecode, "<a id=""J_SellerRate"" href=""javascript:void(0)"">", "</a>", -1)
                shopxinyong = Replace(shopxinyong, vbTab, "")
                shopxinyong = Replace(shopxinyong, vbNewLine, "")
                shopxinyong = Trim(shopxinyong)
            End If

            If Saller = "" Then Saller = gethtml(ratecode, "J_WangWang"" data-nick=""", """ data-tnick=")
            'Response.Write(Saller)
            'Response.End()
            shopxinyong = Int(shopxinyong)
            If shopxinyong = -1 Then
                shopdengjiB = "商城"
                shopdengjipic = "images/store.gif"
            End If
            If shopxinyong >= 4 And shopxinyong <= 10 Then
                shopdengjiB = "一星"
                shopdengjipic = "http://pics.taobaocdn.com/newrank/s_red_1.gif"
            End If
            If shopxinyong >= 11 And shopxinyong <= 40 Then
                shopdengjiB = "双星"
                shopdengjipic = "http://pics.taobaocdn.com/newrank/s_red_2.gif"
            End If
            If shopxinyong >= 41 And shopxinyong <= 90 Then
                shopdengjiB = "三星"
                shopdengjipic = "http://pics.taobaocdn.com/newrank/s_red_3.gif"
            End If
            If shopxinyong >= 91 And shopxinyong <= 150 Then
                shopdengjiB = "四星"
                shopdengjipic = "http://pics.taobaocdn.com/newrank/s_red_4.gif"
            End If
            If shopxinyong >= 151 And shopxinyong <= 250 Then
                shopdengjiB = "五星"
                shopdengjipic = "http://pics.taobaocdn.com/newrank/s_red_5.gif"
            End If
            If shopxinyong >= 251 And shopxinyong <= 500 Then
                shopdengjiB = "一钻"
                shopdengjipic = "http://pics.taobaocdn.com/newrank/s_blue_1.gif"
            End If
            If shopxinyong >= 501 And shopxinyong <= 1000 Then
                shopdengjiB = "双钻"
                shopdengjipic = "http://pics.taobaocdn.com/newrank/s_blue_2.gif"
            End If
            If shopxinyong >= 1001 And shopxinyong <= 2000 Then
                shopdengjiB = "三钻"
                shopdengjipic = "http://pics.taobaocdn.com/newrank/s_blue_3.gif"
            End If
            If shopxinyong >= 2001 And shopxinyong <= 5000 Then
                shopdengjiB = "四钻"
                shopdengjipic = "http://pics.taobaocdn.com/newrank/s_blue_4.gif"
            End If
            If shopxinyong >= 5001 And shopxinyong <= 10000 Then
                shopdengjiB = "五钻"
                shopdengjipic = "http://pics.taobaocdn.com/newrank/s_blue_5.gif"
            End If
            If shopxinyong >= 10001 And shopxinyong <= 20000 Then
                shopdengjiB = "一冠"
                shopdengjipic = "http://pics.taobaocdn.com/newrank/s_cap_1.gif"
            End If
            If shopxinyong >= 20001 And shopxinyong <= 50000 Then
                shopdengjiB = "双冠"
                shopdengjipic = "http://pics.taobaocdn.com/newrank/s_cap_2.gif"
            End If
            If shopxinyong >= 50001 And shopxinyong <= 100000 Then
                shopdengjiB = "三冠"
                shopdengjipic = "http://pics.taobaocdn.com/newrank/s_cap_3.gif"
            End If
            If shopxinyong >= 100001 And shopxinyong <= 200000 Then
                shopdengjiB = "四冠"
                shopdengjipic = "http://pics.taobaocdn.com/newrank/s_cap_4.gif"
            End If
            If shopxinyong >= 200001 And shopxinyong <= 500000 Then
                shopdengjiB = "五冠"
                shopdengjipic = "http://pics.taobaocdn.com/newrank/s_cap_5.gif"
            End If
            If shopxinyong >= 500001 And shopxinyong <= 1000000 Then
                shopdengjiB = "一金冠"
                shopdengjipic = "http://pics.taobaocdn.com/newrank/s_crown_1.gif"
            End If
            If shopxinyong >= 1000001 And shopxinyong <= 2000000 Then
                shopdengjiB = "双金冠"
                shopdengjipic = "http://pics.taobaocdn.com/newrank/s_crown_2.gif"
            End If
            If shopxinyong >= 2000001 And shopxinyong <= 5000000 Then
                shopdengjiB = "三金冠"
                shopdengjipic = "http://pics.taobaocdn.com/newrank/s_crown_3.gif"
            End If
            If shopxinyong >= 5000001 And shopxinyong <= 10000000 Then
                shopdengjiB = "四金冠"
                shopdengjipic = "http://pics.taobaocdn.com/newrank/s_crown_4.gif"
            End If
            If shopxinyong > 10000000 Then
                shopdengjiB = "五金冠"
                shopdengjipic = "http://pics.taobaocdn.com/newrank/s_crown_5.gif"
            End If

            If InStr(code, "<div class=""shopman entry-title"">") = 0 Then
                'Response.Write("GetSaller|error|请确认您输入的链接为一个正常的淘宝店铺或者商品地址！")
                'Response.End()
            End If
            If shopxinyong = -1 Then
                code = Right(code, Len(code) - InStr(code, "<span>掌柜：</span>"))
                code = Left(code, InStr(code, "<div class=""other"">"))
                shopxinyong = 0
            Else
                code = Right(code, Len(code) - InStr(code, "掌柜档案"))
                code = Left(code, InStr(code, "卖家发货的速度"))
                'Saller = gethtml(code, """nick=", "&")
            End If
            Dim g
            If shopEvaluation = "" Then
                shopEvaluation = gethtml(code, "<span>卖家好评率：</span>", "</li>")
                shopEvaluation = Replace(shopEvaluation, "<strong>", "")
                shopEvaluation = Replace(shopEvaluation, "</strong>", "")
            End If


            g = SerachSaller(Saller)
            If g <> "NO" Then
                Response.Write("GetSaller|OK|" & g & "|" & shopxinyong & "|" & shopdengjiB & "|" & shopdengjipic & "|" & shopEvaluation)
            Else
                Response.Write("GetSaller|error|该店铺没有加入淘宝客推广")
            End If

            Response.End()

        End If
        If Request("Action") = "PutShopInfo" Then
            Dim connstr, conn, rs, shopid, dj
            connstr = ConfigurationSettings.AppSettings("SQLConnString") & """" & Server.MapPath(".") & "\..\" & ConfigurationSettings.AppSettings("dbPath") & """"
            conn = Server.CreateObject("ADODB.Connection")
            conn.open(connstr)
            shopid = gethtml(LCase(Request("Url_Url")), "http://shop", ".taobao")


            rs = Server.CreateObject("adodb.recordset")
            rs.open("select top 1 * from [url] where shopid='" & shopid & "'", conn, 1, 3)
            If rs.eof Then
                rs.addnew()
                Response.Write("AddShop|OK|0")
            Else
                Response.Write("AddShop|OK|1")
            End If
            dj = Split(getdj(Request("shopCredit")), ",")

            rs("CONTACT").value = Request("CONTACT")
            rs("shopEvaluation").value = Request("shopEvaluation")
            rs("shopCredit").value = Request("shopCredit")
            rs("Url_Name").value = Request("Url_Name")
            rs("SHOPURL").value = Request("SHOPURL")
            rs("Url_Url").value = Request("Url_Url")
            rs("MEMBERID").value = Request("MEMBERID")
            rs("commissionRate").value = Request("commissionRate")
            rs("TOTALACTION").value = Request("TOTALACTION")
            rs("shopclass").value = Request("shopclass")
            rs("PICTURL").value = Request("PICTURL")
            rs("shopid").value = shopid
            rs("EXLEVEL").value = dj(0)
            rs.update()
            rs.close()
            conn.close()
            Response.End()
        End If



    End Sub
    Function PassPortCheck()
        Dim connstr, connA, rsA
        connstr = ConfigurationSettings.AppSettings("SQLConnString") & """" & Server.MapPath(".") & "\..\" & ConfigurationSettings.AppSettings("dbPath") & """"
        connA = Server.CreateObject("ADODB.Connection")
        connA.open(connstr)
        Dim Admin_UserName, Admin_UserPass
        Admin_UserName = replace(Request.Cookies("TaoddAdmin").value, "'", "''")
        Admin_UserPass = replace(Request.Cookies("TaoddPassWord").value, "'", "''")
        rsA = Server.CreateObject("adodb.recordset")
        rsA.open("select * from [admin^] where Admin_UserName='" & Admin_UserName & "' and Admin_UserPass='" & Admin_UserPass & "'", connA, 1, 3)
        If rsA.eof Then
            Response.Redirect("login.aspx")
        End If
        connA.close()
        connA = Nothing
    End Function
    Function gethtml(ByVal tmp, ByVal s, ByVal e, ByVal id)
        On Error Resume Next
        Dim String1, String2, arrstr, j
        String1 = s
        String2 = e
        Dim fbegin
        Dim fend
        fbegin = 1
        fend = 1
        j = 0
        Do
            fbegin = InStr(fbegin, tmp, String1)
            If fbegin = 0 Then Exit Function
            fend = InStr(fbegin, tmp, String2)
            arrstr = Mid(tmp, fbegin + Len(String1), fend - (fbegin + Len(String1)))
            gethtml = arrstr
            If id <> -1 Then
                CArray(j, id) = arrstr
                j = j + 1
            Else
                Exit Function
            End If


            fbegin = fend + Len(String2)
        Loop While True
    End Function
    Function SerachSaller(ByVal Saller)
        Dim url, tempcode, a, i, max, k, taokeurl
        url = "http://taoke.alimama.com/spreader/search_shop_from_engine.do?_input_charset=gb2312&catid=0&schcontent=" & Server.UrlEncode(Saller)
        tempcode = getstr(url)
        If InStr(tempcode, ",""TITLE"":""") = 0 Then
            SerachSaller = "NO"
            Exit Function
        End If
        a = gethtml(tempcode, ",""TITLE"":""", """}", 0)  '店铺名称
        a = gethtml(tempcode, """CONTACT"":""", """,""ORIMEMBERID"":", 1)  '店铺主人
        a = gethtml(tempcode, ",""SHOPURL"":""", """,""ISCPS"":", 2) '店铺网址
        a = gethtml(tempcode, ",""EXLEVEL"":""", """,""STATUS"":", 3) '店铺等级
        a = gethtml(tempcode, """,""MEMBERID"":""", """,""SHOPTYPE"":", 4) '店铺ID
        a = gethtml(tempcode, """,""PICTURL"":""", """,""CATNAME"":""", 5) '店铺店标
        a = gethtml(tempcode, ",""AUCTIONCOUNT"":""", """,""TOTALACTION"":", 6) '商品总量
        a = gethtml(tempcode, """,""TOTALACTION"":""", """,""SORTRANK"":", 7) '累计推广量
        a = gethtml(tempcode, """COMMISSIONRATE"":""", """,""RANK_SCORE"":", 8) '佣金比例*0.01
        a = gethtml(tempcode, "CATNAME"":""", """,""COMMISSIONRATE", 9) '店铺分类
        SerachSaller = ""
        max = Int(gethtml(tempcode, ",""max"":", ",""cur"))
        For i = 0 To 19
            If CArray(i, 1) = Saller Then
                url = "http://taoke.alimama.com/spreader/gen_shop_code.htm?pid=" & CArray(i, 4)
                tempcode = getstr(url)
                taokeurl = Replace(gethtml(tempcode, "txt_urlcode"" name=""foroverflow"">", "</textarea>", -1), "10011550", "Pid")
                SerachSaller = CArray(i, 1) & "|" & CArray(i, 0) & "|" & CArray(i, 2) & "|" & CArray(i, 4) & "|" & CArray(i, 5) & "|" & CArray(i, 7) & "|" & Int(CArray(i, 8)) * 0.01 & "|" & taokeurl & "|" & CArray(i, 9)
            End If
        Next
        If SerachSaller = "" Then
            max = Int(gethtml(tempcode, ",""max"":", ",""cur"))
            If max > 1 Then
                For i = 2 To max
                    url = "http://taoke.alimama.com/spreader/search_shop_from_engine.do?_input_charset=gb2312&catid=0&schcontent=" & Server.UrlEncode(Saller) & "&p=" & i
                    tempcode = getstr(url)
                    ReDim CArray(40, 10)
                    a = gethtml(tempcode, ",""TITLE"":""", """}", 0)  '店铺名称
                    a = gethtml(tempcode, """CONTACT"":""", """,""ORIMEMBERID"":", 1)  '店铺主人
                    a = gethtml(tempcode, ",""SHOPURL"":""", """,""ISCPS"":", 2) '店铺网址
                    a = gethtml(tempcode, ",""EXLEVEL"":""", """,""STATUS"":", 3) '店铺等级
                    a = gethtml(tempcode, """,""MEMBERID"":""", """,""EXLEVEL"":", 4) '店铺ID
                    a = gethtml(tempcode, """,""PICTURL"":""", """,""CATNAME"":""", 5) '店铺店标
                    a = gethtml(tempcode, ",""AUCTIONCOUNT"":""", """,""TOTALACTION"":", 6) '商品总量
                    a = gethtml(tempcode, """,""TOTALACTION"":""", """,""SORTRANK"":", 7) '累计推广量
                    a = gethtml(tempcode, """COMMISSIONRATE"":""", """,""RANK_SCORE"":", 8) '佣金比例*0.01
                    a = gethtml(tempcode, "CATNAME"":""", """,""COMMISSIONRATE", 9) '店铺分类
                    For k = 0 To 19
                        If CArray(k, 1) = Saller Then
                            url = "http://taoke.alimama.com/spreader/gen_shop_code.htm?pid=" & CArray(i, 4)
                            tempcode = getstr(url)
                            taokeurl = Replace(gethtml(tempcode, "txt_urlcode"" name=""foroverflow"">", "</textarea>", -1), "10011550", "Pid")
                            SerachSaller = CArray(k, 1) & "|" & CArray(k, 0) & "|" & CArray(k, 2) & "|" & CArray(k, 4) & "|" & CArray(k, 5) & "|" & CArray(k, 7) & "|" & Int(CArray(k, 8)) * 0.01 & "|" & taokeurl & "|" & CArray(i, 9)
                        End If
                    Next
                Next
            End If
        End If
        If SerachSaller = "" Then SerachSaller = "NO"
    End Function
    Function getdj(ByVal shopxinyong)
        If isDBNull(shopxinyong) Then shopxinyong = 0
        Dim shopdengjiB, shopdengjipic
        shopxinyong = int(shopxinyong)
        If shopxinyong = -1 Then
            shopdengjiB = "商城"
            shopdengjipic = "images/store.gif"
        End If
        If shopxinyong >= 1 And shopxinyong <= 10 Then
            shopdengjiB = "一星"
            shopdengjipic = "http://pics.taobaocdn.com/newrank/s_red_1.gif"
        End If
        If shopxinyong >= 11 And shopxinyong <= 40 Then
            shopdengjiB = "双星"
            shopdengjipic = "http://pics.taobaocdn.com/newrank/s_red_2.gif"
        End If
        If shopxinyong >= 41 And shopxinyong <= 90 Then
            shopdengjiB = "三星"
            shopdengjipic = "http://pics.taobaocdn.com/newrank/s_red_3.gif"
        End If
        If shopxinyong >= 91 And shopxinyong <= 150 Then
            shopdengjiB = "四星"
            shopdengjipic = "http://pics.taobaocdn.com/newrank/s_red_4.gif"
        End If
        If shopxinyong >= 151 And shopxinyong <= 250 Then
            shopdengjiB = "五星"
            shopdengjipic = "http://pics.taobaocdn.com/newrank/s_red_5.gif"
        End If
        If shopxinyong >= 251 And shopxinyong <= 500 Then
            shopdengjiB = "一钻"
            shopdengjipic = "http://pics.taobaocdn.com/newrank/s_blue_1.gif"
        End If
        If shopxinyong >= 501 And shopxinyong <= 1000 Then
            shopdengjiB = "双钻"
            shopdengjipic = "http://pics.taobaocdn.com/newrank/s_blue_2.gif"
        End If
        If shopxinyong >= 1001 And shopxinyong <= 2000 Then
            shopdengjiB = "三钻"
            shopdengjipic = "http://pics.taobaocdn.com/newrank/s_blue_3.gif"
        End If
        If shopxinyong >= 2001 And shopxinyong <= 5000 Then
            shopdengjiB = "四钻"
            shopdengjipic = "http://pics.taobaocdn.com/newrank/s_blue_4.gif"
        End If
        If shopxinyong >= 5001 And shopxinyong <= 10000 Then
            shopdengjiB = "五钻"
            shopdengjipic = "http://pics.taobaocdn.com/newrank/s_blue_5.gif"
        End If
        If shopxinyong >= 10001 And shopxinyong <= 20000 Then
            shopdengjiB = "一皇冠"
            shopdengjipic = "http://pics.taobaocdn.com/newrank/s_cap_1.gif"
        End If
        If shopxinyong >= 20001 And shopxinyong <= 50000 Then
            shopdengjiB = "双皇冠"
            shopdengjipic = "http://pics.taobaocdn.com/newrank/s_cap_2.gif"
        End If
        If shopxinyong >= 50001 And shopxinyong <= 100000 Then
            shopdengjiB = "三皇冠"
            shopdengjipic = "http://pics.taobaocdn.com/newrank/s_cap_3.gif"
        End If
        If shopxinyong >= 100001 And shopxinyong <= 200000 Then
            shopdengjiB = "四皇冠"
            shopdengjipic = "http://pics.taobaocdn.com/newrank/s_cap_4.gif"
        End If
        If shopxinyong >= 200001 And shopxinyong <= 500000 Then
            shopdengjiB = "五皇冠"
            shopdengjipic = "http://pics.taobaocdn.com/newrank/s_cap_5.gif"
        End If
        If shopxinyong >= 500001 And shopxinyong <= 1000000 Then
            shopdengjiB = "一金冠"
            shopdengjipic = "http://pics.taobaocdn.com/newrank/s_crown_1.gif"
        End If
        If shopxinyong >= 1000001 And shopxinyong <= 2000000 Then
            shopdengjiB = "双金冠"
            shopdengjipic = "http://pics.taobaocdn.com/newrank/s_crown_2.gif"
        End If
        If shopxinyong >= 2000001 And shopxinyong <= 5000000 Then
            shopdengjiB = "三金冠"
            shopdengjipic = "http://pics.taobaocdn.com/newrank/s_crown_3.gif"
        End If
        If shopxinyong >= 5000001 And shopxinyong <= 10000000 Then
            shopdengjiB = "四金冠"
            shopdengjipic = "http://pics.taobaocdn.com/newrank/s_crown_4.gif"
        End If
        If shopxinyong > 10000000 Then
            shopdengjiB = "五金冠"
            shopdengjipic = "http://pics.taobaocdn.com/newrank/s_crown_5.gif"
        End If
        getdj = shopdengjiB & "," & shopdengjipic
    End Function

End Class
